package by.wind.drebedengi.datalayer;

import java.util.Hashtable;
import java.util.Iterator;
import java.util.Map;

public class SetRecordElementResult {
	
	public final static String INSERTED = "inserted";
	public final static String STATUS = "status";
	public final static String CLIENT_ID = "client_id";
	public final static String SERVER_ID = "server_id";
	
	private String status;
	private long client_id;
	private long server_id;
	
	SetRecordElementResult(Hashtable<String,String> aValue) {
		Iterator<Map.Entry<String,String>> iterator = aValue.entrySet().iterator();
		while(iterator.hasNext()) {
			String key = iterator.next().getKey();
			Object value = aValue.get(key);
			System.out.println("key="+key+", value="+value);
			if (key.equals(STATUS)) {
				status = String.valueOf(value);
			} else if (key.equals(CLIENT_ID)) {
				client_id = Long.parseLong(String.valueOf(value));
			} else if (key.equals(SERVER_ID)) {
				server_id = Long.parseLong(String.valueOf(value));
			}
		}
	}
	
	public String getStatus() {
		return status;
	}
	public void setStatus(String status) {
		this.status = status;
	}
	public long getClient_id() {
		return client_id;
	}
	public void setClient_id(long client_id) {
		this.client_id = client_id;
	}
	public long getServer_id() {
		return server_id;
	}
	public void setServer_id(long server_id) {
		this.server_id = server_id;
	}
}
